﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace MShop.Core.Domain
{
    [MetadataType(typeof(ArticleCategory_Validation))]
    public partial class ArticleCategory
    {
        public ArticleCategory()
        {
            this.Created = DateTime.Now;
            this.Sort = 1;           
        }
    }


    internal partial class ArticleCategory_Validation
    {
        [DisplayName("分类名称")]
        [Required(ErrorMessage = "分类名称不能为空")]
        public string Name { get; set; }
        [DisplayName("分类排序")]
        [Required(ErrorMessage = "分类排序不能为空")]
        [Range(1,1000,ErrorMessage="请输入排序的整数(1-1000)")]
        public int Sort { get; set; }
    }
}